﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IService.Utility;
using IService.DataDLL.Utility;

namespace IService
{
	public partial class Login : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{

		}

		protected void btnLogin_Click(object sender, EventArgs e)
		{
			string username = txtUserName.Text.Trim();
            string password = Md5Helper.md5(txtPassword.Text.Trim(), 32);  //DEncrypt.Encrypt(txtPassword.Text.Trim());
			Model.User user = Business.DTVBusiness.UserManager.Login(username, password);
			if (user == null)
			{
				WebMessageBox.Show(this.Page, "输入的会员账号或密码不正确！");
			}
			else
			{
				SessionState.CurrentUser = user;
                //WebMessageBox.ShowAndRedirect(this.Page, "登录成功！", "User_center/uc_1_1.aspx");
                Response.Redirect("User_center/index.aspx");
			}
		}
	}
}